<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>组件配置 | d2-crud-plus</title>
    <meta name="description" content="d2-crud-plus doc">
    <link rel="icon" href="/d2-crud-plus/icon-only.png">
  <link rel="manifest" href="/d2-crud-plus/manifest.json">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <link rel="apple-touch-icon" href="/d2-crud-plus/icons/apple-touch-icon-152x152.png">
  <link rel="mask-icon" href="/d2-crud-plus/icons/safari-pinned-tab.svg" color="#3eaf7c">
  <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
  <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/d2-crud-plus/assets/css/0.styles.064dabed.css" as="style"><link rel="preload" href="/d2-crud-plus/assets/js/app.f0d9ff85.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/2.38672536.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/19.d09a2642.js" as="script"><link rel="prefetch" href="/d2-crud-plus/assets/js/10.f1640317.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/11.3f07efd3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/12.669e2b1e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/13.c4049de1.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/14.d49145eb.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/15.34942d5f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/16.8a04e3e3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/17.4b2cbd02.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/18.32f8a17a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/20.ba5679ee.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/21.820ed550.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/22.d150102e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/23.3df1cd2a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/24.13ec50db.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/25.5d83f586.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/26.835a0f94.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/27.e8688dc9.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/28.34dfee10.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/29.b4779938.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/3.2fb80fae.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/30.d9908c63.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/31.22b63695.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/32.8cf46637.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/33.49cb5c72.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/34.d5dad95f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/35.2951adfb.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/36.f94bf8c7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/37.6d5e3699.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/38.f04b120f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/39.918c25de.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/4.04f0f927.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/40.d44703c2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/41.12cd1358.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/42.30f08cc6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/43.5d128aa6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/44.4fb1bb4c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/45.4a5203d4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/46.50e4689c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/47.9e220530.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/48.363696ad.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/49.227bba07.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/5.83a43c44.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/50.e114ae19.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/51.177a5448.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/52.760a9431.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/53.ae15ab8e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/54.9cecab22.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/55.7c1e0fb0.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/56.5361444a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/57.80d5fc95.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/58.4fa37427.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/59.d2af4e99.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/6.b091c884.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/60.e4f170c2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/61.7a38b584.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/7.ceb2417c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/8.da261fbb.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/9.68c18515.js">
    <link rel="stylesheet" href="/d2-crud-plus/assets/css/0.styles.064dabed.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/d2-crud-plus/" class="home-link router-link-active"><!----> <span class="site-name">d2-crud-plus</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">指南</a></div><div class="nav-item"><a href="http://qiniu.veryreader.com/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">指南</a></div><div class="nav-item"><a href="http://qiniu.veryreader.com/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/" class="sidebar-link">介绍</a></li><li><a href="/d2-crud-plus/guide/quickstart.html" class="sidebar-link">快速上手</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>进阶</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/mixins.html" class="sidebar-link">d2CrudPlus.crud</a></li><li><a href="/d2-crud-plus/guide/options.html" class="sidebar-link">crud配置项</a></li><li><a href="/d2-crud-plus/guide/component.html" class="active sidebar-link">组件配置</a></li><li><a href="/d2-crud-plus/guide/column-type.html" class="sidebar-link">字段类型</a></li><li><a href="/d2-crud-plus/guide/types.html" class="sidebar-link">字段类型列表</a></li><li><a href="/d2-crud-plus/guide/extends.html" class="sidebar-link">自定义扩展</a></li><li><a href="/d2-crud-plus/guide/slot.html" class="sidebar-link">slot自定义</a></li><li><a href="/d2-crud-plus/guide/dict.html" class="sidebar-link">数据字典</a></li><li><a href="/d2-crud-plus/guide/event.html" class="sidebar-link">事件监听</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>附加功能</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/permission.html" class="sidebar-link">权限管理</a></li><li><a href="/d2-crud-plus/guide/generate.html" class="sidebar-link">代码生成</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>d2p-extends文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/extends/area-selector.html" class="sidebar-link">省市区选择组件</a></li><li><a href="/d2-crud-plus/guide/extends/avatar-cropper.html" class="sidebar-link">头像裁剪上传</a></li><li><a href="/d2-crud-plus/guide/extends/file-uploader.html" class="sidebar-link">文件上传组件</a></li><li><a href="/d2-crud-plus/guide/extends/icon-selector.html" class="sidebar-link">icon选择组件</a></li><li><a href="/d2-crud-plus/guide/extends/tree-selector.html" class="sidebar-link">树形选择组件</a></li><li><a href="/d2-crud-plus/guide/extends/uploader.html" class="sidebar-link">文件上传lib</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>组件文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/components/cascade-format.html" class="sidebar-link">cascade-format</a></li><li><a href="/d2-crud-plus/guide/components/cascade-select.html" class="sidebar-link">cascade-select</a></li><li><a href="/d2-crud-plus/guide/components/d2p-cropper.html" class="sidebar-link">d2p-cropper</a></li><li><a href="/d2-crud-plus/guide/components/d2p-cropper-uploader.html" class="sidebar-link">d2p-cropper-uploader</a></li><li><a href="/d2-crud-plus/guide/components/d2p-file-uploader.html" class="sidebar-link">d2p-file-uploader</a></li><li><a href="/d2-crud-plus/guide/components/d2p-files-format.html" class="sidebar-link">d2p-files-format</a></li><li><a href="/d2-crud-plus/guide/components/d2p-icon.html" class="sidebar-link">d2p-icon</a></li><li><a href="/d2-crud-plus/guide/components/d2p-icon-select.html" class="sidebar-link">d2p-icon-select</a></li><li><a href="/d2-crud-plus/guide/components/d2p-images-format.html" class="sidebar-link">d2p-images-format</a></li><li><a href="/d2-crud-plus/guide/components/d2p-quill.html" class="sidebar-link">d2p-quill</a></li><li><a href="/d2-crud-plus/guide/components/d2p-tree-selector.html" class="sidebar-link">d2p-tree-selector</a></li><li><a href="/d2-crud-plus/guide/components/d2p-ueditor.html" class="sidebar-link">d2p-ueditor</a></li><li><a href="/d2-crud-plus/guide/components/date-format.html" class="sidebar-link">date-format</a></li><li><a href="/d2-crud-plus/guide/components/dict-checkbox.html" class="sidebar-link">dict-checkbox</a></li><li><a href="/d2-crud-plus/guide/components/dict-radio.html" class="sidebar-link">dict-radio</a></li><li><a href="/d2-crud-plus/guide/components/dict-select.html" class="sidebar-link">dict-select</a></li><li><a href="/d2-crud-plus/guide/components/dict-switch.html" class="sidebar-link">dict-switch</a></li><li><a href="/d2-crud-plus/guide/components/text-area.html" class="sidebar-link">text-area</a></li><li><a href="/d2-crud-plus/guide/components/values-format.html" class="sidebar-link">values-format</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>ChangeLog</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus/CHANGELOG.html" class="sidebar-link">d2-crud-plus</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus-extends/CHANGELOG.html" class="sidebar-link">d2-crud-plus-extends</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus-example/CHANGELOG.html" class="sidebar-link">d2-crud-plus-example</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>其他帮助</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/questions.html" class="sidebar-link">常见问题</a></li><li><a href="/d2-crud-plus/guide/contact.html" class="sidebar-link">联系作者</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="组件配置"><a href="#组件配置" class="header-anchor">#</a> 组件配置</h1> <p>表单组件、行组件都是通过<code>render-custom-component</code>进行动态生成的。<br>
每一列的配置中有三处地方可以配置component：</p> <ol><li>column.form.component = 表单组件配置</li> <li>column.component = 表格行展示组件配置</li> <li>column.search.component = 查询表单组件配置</li></ol> <p>通过component.name 配置组件名称<br>
通过component.props 配置组件参数<br>
默认监听input和change事件<br>
使用相关组件前，需要通过<code>Vue.use</code> 或 <code>Vue.component</code>引入组件</p> <div class="language-js extra-class"><pre class="language-js"><code>component<span class="token punctuation">:</span><span class="token punctuation">{</span> 
    name<span class="token punctuation">:</span> <span class="token string">'dict-select'</span><span class="token punctuation">,</span><span class="token comment">//组件的名称</span>
    props<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// 组件的配置，具体有哪些参数请查看相关组件的说明文档</span>
       multiple<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
       elProps<span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">// 如果该组件封装了element组件，则此属性下面配置封装组件的配置</span>
       <span class="token comment">//类似的还有 uploader、cropper等</span>
       uploader<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span> <span class="token comment">//如果该组件封装了uploader，此属性下配置uploader的配置   </span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span> 
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/greper/d2-crud-plus/edit/master//docs/guide/component.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2020-5-17 15:24:10</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/d2-crud-plus/guide/options.html" class="prev">crud配置项</a></span> <span class="next"><a href="/d2-crud-plus/guide/column-type.html">字段类型</a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/d2-crud-plus/assets/js/app.f0d9ff85.js" defer></script><script src="/d2-crud-plus/assets/js/2.38672536.js" defer></script><script src="/d2-crud-plus/assets/js/19.d09a2642.js" defer></script>
  </body>
</html>
